/**
 * @description 计算
 * @license Apache License Version 2.0
 * @Copyright (c) 2025-now by yuan
 * @remarks
 
 * 
 */

import { isNumber, isString } from "./is";

/**
 * 处理css单位
 * */
export function cssUnit(value: string | number, unit = "px") {
  return isNumber(value) || (isString(value) && value.indexOf(unit as string) === -1) ? `${value}${unit}` : value;
}
